/*
 * 百度在线网络技术（北京）有限公司拥有本软件版权2022并保留所有权利。
 * Copyright 2022, Baidu.com,Inc 2:Baidu Online Network Technology (Beijing) Co.,Ltd,
 * All rights reserved.
 */

package com.azdebugit.hash.map.test.othermap.test.list2;

import java.util.Comparator;

class MyCompartor implements Comparator {
    @Override
    public int compare(Object o1, Object o2) {
        StudentDTO sdto1 = (StudentDTO) o1;
        int age1 = sdto1.getAge();
        StudentDTO sdto2 = (StudentDTO) o2;
        int age2 = sdto2.getAge();
//        return sdto1.getAge.compareTo(stdo2.getAge());
        return age1-age2>0?1:-1;
    }
}